import { reactive, ref } from 'vue'
import { VxeGridProps } from 'vxe-table'

const gridOptions = reactive<VxeGridProps<any>>({
  border: true,
  height: 300,
  align: 'center',
  loading: false,
  columnConfig: {
    resizable: true,
  },
  columns: [
    { field: 'id', title: '记录ID' },
    { field: 'baseSituation', title: '申报自主创新产品基本情况' },
    { field: 'reportUnitName', title: '上报单位' },
    { field: 'reportPersonName', title: '上报人' },
    { field: 'createTime', title: '记录创建时间' ,  formatter: ['formatDate', 'yyyy-MM-dd']},
    { title: '操作', width: 200, slots: { default: 'operate' } },
  ],  
  data: [],
})

const operationLog = reactive<VxeGridProps>({
  border: true,
  height: 300,
  align: 'center',
  loading: false,
  columnConfig: {
    resizable: true,
  },
  columns: [
    { field: 'type', title: '操作类型', width: 200 },
    { field: 'name', title: '操作员', width: 200 },
    { field: 'content', title: '操作内容' },
    { field: 'date', title: '操作时间', width: 200 },
  ],
  toolbarConfig: {
    slots: {
      buttons: 'toolbar_buttons',
    },
  },
  data: [
    {
      type: '修改状态',
      name: '曲丽丽',
      content: '修改了“软件名称”',
      date: '2023-01-01 00:00:00',
    },
    {
      type: '新增信息',
      name: '周毛毛',
      content: '新增软著信息',
      date: '2023-01-01 00:00:00',
    },
  ],
})

const formList = ref([
  {
    label: '一、申报自主创新产品基本情况',
    prop: 'baseSituation',
  },
  {
    label: '二、申报自主创新产品知识产权情况',
    prop: 'knowledgeOwnerSituation',
  },
  {
    label: '三、申报自主创新产品自主品牌情况',
    prop: 'brandSituation',
  },
  {
    label: '四、申报自主创新产品创新性及技术水平',
    prop: 'innovateLevelSituation',
  },
  {
    label: '五、申报自主创新产品市场前景和经济效益',
    prop: 'futureBenefitSituation',
  },
  {
    label: '六、申报单位推荐意见',
    prop: 'declareUnitOpinion',
  },
])

export { gridOptions, operationLog, formList }
